<%--
  Created by IntelliJ IDEA.
  User: 86186
  Date: 2022/3/30
  Time: 18:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
	<title>登录</title>
	<script src="${pageContext.request.contextPath}/static/assets/js/jquery-3.6.0.min.js"></script>
	<!-- Bootstrap Js -->
	<!-- <script src="${pageContext.request.contextPath}/static/assets/js/bootstrap.min.js"></script> -->
	<!-- Metis Menu Js -->
	<!-- <script src="${pageContext.request.contextPath}/static/assets/js/jquery.metisMenu.js"></script> -->
	<!-- Custom Js -->
	<!-- <script src="${pageContext.request.contextPath}/static/assets/js/custom-scripts.js"></script> -->
	<style type="text/css">
		#login{
			/* border: 1px solid black; */
			width: 700px;
			height: 350px;
			box-sizing: border-box;
			background-color: palegreen;
		}
		div{
			margin: 0px auto;
			/* border: 1px solid red; */
		}
		table{
			padding-top: 20%;
			margin-bottom: 10px;
		}
		table>tr{
			margin-top: 20px;
		}
		#verify{
			width: 70px;
		}
	</style>
</head>
<body>
    <div id="" >
    	<div id="login" align="center">
    		<form action="loginfo.do?choick=login" method="post">
				<table border="0" cellspacing="" cellpadding="">
					<tr><th>用户名：</th>
						<td><input type="text" name="userName" value="" /></td>
					</tr>
					<tr><th><label>密 &nbsp; 码：</label></th>
						<td><input type="password" name="password" value="" /></td>
					</tr>
					<tr>
						<th><label>验证码：</label></th>
						<td>
							<input type="text" name="verify" value="" id="verify"/>
							<span id="verifybtn">点击此处获取验证码</span>
						</td>
						
					</tr>
				</table>
				<br>
    			<input type="submit" value="登录"/>
				<input type="reset" value="重置">
    		</form>
    	</div>
    </div>
</body>
<script type="text/javascript">
	$(document).ready(function(){
			// // x上限，y下限
			// var x = 10000;
			// var y = 1000;
			// var rand = parseInt(Math.random() * (x - y + 1) + y);
			// $("#login>form>span").text(rand)


	$("#verifybtn").click(function (){
		// alert("adasdas")
		var num = $(this).val();
		var verify =$(this);
		$.ajax({
			url:"${pageContext.request.contextPath}/loginfo.do?choick=verify",
			type:"post",
			data:{
				// num:num
			},
			dataType:"JSON",
			success:function (data){
				// alert("以获取");
				// alert(data.result)
				if(data.result!=null){
					// verify.text().empty();
					verify.text(data.result)

				}
			}
		})
	})
	 })
</script>

</html>

